﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MetadataBasedConfig.Framework.Model;

namespace MetadataBasedConfig.Framework.Validator
{
    public class ConfigInfoPropertyValidatContext
    {
        public ConfigInfoPropertyValidatContext(Object sourceValue, SourceType sourceType)
        {
            SourceValue = sourceValue;
            SourceType = sourceType;
            TargetValue = sourceValue;
            IsValid = true;
            Canceled = false; 
        }

        #region Properties

        public Object SourceValue
        {
            get;
            set;
        }

        public Object TargetValue
        {
            get;
            set;
        }

        public bool IsValid
        {
            get;
            set;
        }

        public bool Canceled
        {
            get;
            set;
        }
        
        public SourceType SourceType
        {
            get;
            set;
        }

        public Exception Exception
        {
            get;
            set;
        }

        public IPropertyContraint Constraint
        {
            get;
            set;
        }
        #endregion
         
    }

    public enum SourceType
    {
        DB,

        CLR
    }
}
